<?php

class CashAdvances extends Zend_Db_Table_Abstract
{
    protected $_name = 'cash_advance_items';
    protected $_rowClass = 'CashAdvance';

    public function getItems()
    {
        $r = $this->fetchAll();
        if(null == $r)
            return array();
        else
            return $r->toArray();
    }

	public function setItems( $items_array )
	{
		$this->delete("true");
		foreach( $items_array as $cash_item )
		{
			if(!empty($cash_item['description']))
				$this->insert( $cash_item );
		}
	}
}

?>
